package example;

import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.awt.Toolkit;
import java.util.ArrayList;
import java.util.Timer;
import java.util.TimerTask;
import java.io.*;
import java.util.*;

public class MiniTask {
	public String cmd;
	public DBConnection dbConn = null;
	public ArrayList<Tuples> localResult;
	public MiniTask(String query) throws RemoteException, Exception {
		dbConn = new DBConnection();
		cmd = query;
	}
	public void run() {
		this.localResult = dbConn.executeQuery(this.cmd);
		//sort it
		
		System.out.println("mini returns " + this.localResult.size());
	}
	
	public synchronized ArrayList<Tuples> getResult() {
		return localResult;
	}

}
